package com.weiai.wedding.dao.cases;


import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.weiai.wedding.entity.cases.Cases;
import com.weiai.wedding.entity.cases.CasesContent;
/**
 * 彩信内容Dao
 * @author xushunxin
 *
 */
public interface CasesContentDao extends
		PagingAndSortingRepository<CasesContent, Long> {
	@Query("select a.cases,a.casesFramenum from CasesContent a where a.cases =:casesId group by a.cases,a.casesFramenum")
	List findCasesContentGroupByFrame(@Param("casesId")Cases cases);
	@Query("select a from CasesContent a where a.cases =:casesId and a.casesFramenum=:casesFramenum and a.resType=:resType")
	CasesContent findCasesContentByFrameAndType(@Param("casesId")Cases cases,@Param("casesFramenum")Long casesFramenum,@Param("resType")String resType);
	@Query("select a from CasesContent a where a.cases =:casesId")
	List<CasesContent> findCasesContentListByCasesId(@Param("casesId")Cases cases);
	@Query("select a from CasesContent a where a.casesContentId =:id")
	CasesContent findContentById(@Param("id")Long id);
}
